﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using FinosLibrary;
using System.Windows.Media.Imaging;
namespace BattleShipOnline {
    [MessageProcess]
    public class HomePageLogic:ModelLogic {
        public class Face {
            public string id { get; set; }
            public string path { get; set; }
            public BitmapImage image { get { return Custom.GetBitmapImage(path); } }
        }
        public Face[] faceList { get; set; }
        [AutoWire]
        public UserModel userModel;
        [MessageMethod]
        public void GotFaceList(Face[] faces) {
            faceList = faces;
            this.NotifyPropertyChanged(x => x.faceList);
        }
        [MessageMethod]
        public void ChangeFace_Success(string path) {
            userModel.self.face = path;
            userModel.self.NotifyPropertyChanged(x => x.faceImage);
        }
        [MessageMethod]
        public void ChangePassword_Success() {
            MessageBox.Show("修改密码成功！");
        }
    }
}
